/**
 * @description:将接口装换为下拉框数据
 * @return {Promise<childrenProps[]>}
 */
export const getSelectChildren = async (
  api: Function,
  label: string,
  value: string,
  isPaging: boolean = true,
  params?: Object
) => {
  let p = {};
  if (isPaging) {
    p = { pageSize: 1000, pageNum: 1, ...params };
  }
  const data = await api(p);

  return changeArrField(isPaging ? data?.records : data, label, value);
};
